#!/usr/bin/python3
# -*- coding:utf-8 -*-

from selenium import webdriver

#配置无界面的options设置

options = webdriver.FirefoxOptions()
options.set_headless()
options.add_argument('--disable-gpu')
#driver = webdriver.Firefox(firefox_options=options)

fp = webdriver.FirefoxProfile()


fp.set_preference("general.useragent.override", "Mozilla/5.0()\
    (iPhone; U; CPU iPhone OS 5_0_1 like Mac OS X;\
    en-us) AppleWebkit/533.17.0 (KHTML, like Gecko)\
    Version/5.0.2 Mobile/8H7 Safari/6533.18.")
fp.update_preferences()


cap = webdriver.DesiredCapabilities.FIREFOX
cap['firefox_profile'] = fp.encoded
#driver = webdriver.Firefox(firefox_profile=fp,firefox_options=options)
driver = webdriver.Firefox(firefox_profile=fp)



